<?php

namespace App\Models;


class Goods extends Orm
{
    protected $table = 'goods';
    protected $dateFormat = 'U';
    public $timestamps = true;
    protected $casts = [
//        'reflex' => 'json',
        'pics'   => 'json'
    ];

    public function shopInfo()
    {
        return $this->belongsTo(Shop::class,'shop_id');
    }

    public function setPicsAttribute($value)
    {
        $this->dealSetImageAttribute('pics', $value);
    }

    public function setDiscoverAttribute($value)
    {
        $this->dealSetImageAttribute('discover', $value);
    }
}
